package com.house.house.entity;

import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.house.house.util.enums.State;

@Entity
@Table(name="t_house")
public class House {
	//基本信息
	private Long houseId;   
	private String houseNo;    //房源编号
	private Integer houseNum;   //门牌号
	private String houseType;   //出租/售
	private State state;
	private Integer floor;       //楼层
	private Float buildArea;   //面积
	private Float userArea;    //使用面积
	private String salePrice;    //均售价
	private String totalSalePrice;    //总价 
	private String rentPrice;   //每月租费
	private String renovation;  //装修（简装、精装...）
	private String structure;   //建筑结构
	private String varieties;   //品种  新房/二手房
	private String purpose;     //用途  住宅、商用
	private String houseStyle;   //房屋类型   几厅几房几卫几阳台   1-1-1-1
	private String orientation;   //房屋朝向
	private String buildTime;   //建筑年代
	@DateTimeFormat(pattern="yyyy/MM/dd HH:mm:ss")
	private Date entrustTime;   //委托时间 
	@DateTimeFormat(pattern="yyyy/MM/dd HH:mm:ss")
	private Date enteringTime;   //录入时间
	private Boolean cerTitle;   //产权证
	private Boolean houseCard;  //房产证
	private String paymentStyle;  //付款方式
//	private List<String> advantage;  //卖点
	private String contacts;   //联系人
	private String contactsPhone;  //联系人电话
	private String housePhoto;    
	
	private Owner owner;
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Long getHouseId() {
		return houseId;
	}

	public String getHouseNo() {
		return houseNo;
	}

	public Integer getHouseNum() {
		return houseNum;
	}

	public String getHouseType() {
		return houseType;
	}
	@Enumerated(EnumType.STRING)
	public State getState() {
		return state;
	}

	public Integer getFloor() {
		return floor;
	}

	public Float getBuildArea() {
		return buildArea;
	}

	public Float getUserArea() {
		return userArea;
	}

	public String getSalePrice() {
		return salePrice;
	}

	public String getTotalSalePrice() {
		return totalSalePrice;
	}

	public String getRentPrice() {
		return rentPrice;
	}

	public String getRenovation() {
		return renovation;
	}

	public String getStructure() {
		return structure;
	}

	public String getVarieties() {
		return varieties;
	}

	public String getPurpose() {
		return purpose;
	}

	public String getHouseStyle() {
		return houseStyle;
	}

	public String getOrientation() {
		return orientation;
	}
	
	@JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss",timezone = "GMT+8")
	public String getBuildTime() {
		return buildTime;
	}
	
	@JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss",timezone = "GMT+8")
	public Date getEntrustTime() {
		return entrustTime;
	}

	public Date getEnteringTime() {
		return enteringTime;
	}

	public Boolean getCerTitle() {
		return cerTitle;
	}

	public Boolean getHouseCard() {
		return houseCard;
	}

	public String getPaymentStyle() {
		return paymentStyle;
	}

	public String getContacts() {
		return contacts;
	}

	public String getContactsPhone() {
		return contactsPhone;
	}

	public String getHousePhoto() {
		return housePhoto;
	}
	@JsonIgnore
	@ManyToOne(cascade=CascadeType.PERSIST)
	public Owner getOwner() {
		return owner;
	}

	public void setHouseId(Long houseId) {
		this.houseId = houseId;
	}

	public void setHouseNo(String houseNo) {
		this.houseNo = houseNo;
	}

	public void setHouseNum(Integer houseNum) {
		this.houseNum = houseNum;
	}

	public void setHouseType(String houseType) {
		this.houseType = houseType;
	}

	public void setState(State state) {
		this.state = state;
	}

	public void setFloor(Integer floor) {
		this.floor = floor;
	}

	public void setBuildArea(Float buildArea) {
		this.buildArea = buildArea;
	}

	public void setUserArea(Float userArea) {
		this.userArea = userArea;
	}

	public void setSalePrice(String salePrice) {
		this.salePrice = salePrice;
	}

	public void setTotalSalePrice(String totalSalePrice) {
		this.totalSalePrice = totalSalePrice;
	}

	public void setRentPrice(String rentPrice) {
		this.rentPrice = rentPrice;
	}

	public void setRenovation(String renovation) {
		this.renovation = renovation;
	}

	public void setStructure(String structure) {
		this.structure = structure;
	}

	public void setVarieties(String varieties) {
		this.varieties = varieties;
	}

	public void setPurpose(String purpose) {
		this.purpose = purpose;
	}

	public void setHouseStyle(String houseStyle) {
		this.houseStyle = houseStyle;
	}

	public void setOrientation(String orientation) {
		this.orientation = orientation;
	}

	public void setBuildTime(String buildTime) {
		this.buildTime = buildTime;
	}

	public void setEntrustTime(Date entrustTime) {
		this.entrustTime = entrustTime;
	}

	public void setEnteringTime(Date enteringTime) {
		this.enteringTime = enteringTime;
	}

	public void setCerTitle(Boolean cerTitle) {
		this.cerTitle = cerTitle;
	}

	public void setHouseCard(Boolean houseCard) {
		this.houseCard = houseCard;
	}

	public void setPaymentStyle(String paymentStyle) {
		this.paymentStyle = paymentStyle;
	}

	public void setContacts(String contacts) {
		this.contacts = contacts;
	}

	public void setContactsPhone(String contactsPhone) {
		this.contactsPhone = contactsPhone;
	}

	public void setHousePhoto(String housePhoto) {
		this.housePhoto = housePhoto;
	}

	public void setOwner(Owner owner) {
		this.owner = owner;
	}
	
	
}

